package com.gs.librarian.model.entity;

// Generated Jul 2, 2012 3:06:20 PM by Hibernate Tools 3.4.0.CR1

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Embedded;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Version;

/**
 * Menu generated by hbm2java
 */
@Entity
@Table(name = "eb_menu")
public class Menu implements java.io.Serializable {

	/**
	 * @uml.property  name="menuId"
	 */
	private long menuId;
	/**
	 * @uml.property  name="menu"
	 * @uml.associationEnd  
	 */
	private Menu menu;
	/**
	 * @uml.property  name="permission"
	 * @uml.associationEnd  
	 */
	private Permission permission;
	/**
	 * @uml.property  name="title"
	 */
	private String title;
	/**
	 * @uml.property  name="action"
	 */
	private String action;
	/**
	 * @uml.property  name="displayOrder"
	 */
	private int displayOrder;
	/**
	 * @uml.property  name="imagePath"
	 */
	private String imagePath;
	/**
	 * @uml.property  name="versionNo"
	 */
	private int versionNo;
	/**
	 * @uml.property  name="menus"
	 */
	private Set<Menu> menus = new HashSet<Menu>(0);
	/**
	 * @uml.property  name="auditProperties"
	 * @uml.associationEnd  
	 */
	private AuditProperties auditProperties;

	public Menu() {
	}

	/**
	 * @return
	 * @uml.property  name="menuId"
	 */
	@Id
	@GeneratedValue
	@Column(name = "MENU_ID", unique = true, nullable = false)
	public long getMenuId() {
		return this.menuId;
	}

	/**
	 * @param menuId
	 * @uml.property  name="menuId"
	 */
	public void setMenuId(long menuId) {
		this.menuId = menuId;
	}

	/**
	 * @return
	 * @uml.property  name="menu"
	 */
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "PARENT_MENU_ID")
	public Menu getMenu() {
		return this.menu;
	}

	/**
	 * @param menu
	 * @uml.property  name="menu"
	 */
	public void setMenu(Menu menu) {
		this.menu = menu;
	}

	/**
	 * @return
	 * @uml.property  name="permission"
	 */
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "PERMISSION_ID")
	public Permission getPermission() {
		return this.permission;
	}

	/**
	 * @param permission
	 * @uml.property  name="permission"
	 */
	public void setPermission(Permission permission) {
		this.permission = permission;
	}

	/**
	 * @return
	 * @uml.property  name="title"
	 */
	@Column(name = "TITLE", nullable = false, length = 55)
	public String getTitle() {
		return this.title;
	}

	/**
	 * @param title
	 * @uml.property  name="title"
	 */
	public void setTitle(String title) {
		this.title = title;
	}

	/**
	 * @return
	 * @uml.property  name="action"
	 */
	@Column(name = "ACTION")
	public String getAction() {
		return this.action;
	}

	/**
	 * @param action
	 * @uml.property  name="action"
	 */
	public void setAction(String action) {
		this.action = action;
	}

	/**
	 * @return
	 * @uml.property  name="displayOrder"
	 */
	@Column(name = "DISPLAY_ORDER", nullable = false)
	public int getDisplayOrder() {
		return this.displayOrder;
	}

	/**
	 * @param displayOrder
	 * @uml.property  name="displayOrder"
	 */
	public void setDisplayOrder(int displayOrder) {
		this.displayOrder = displayOrder;
	}

	/**
	 * @return
	 * @uml.property  name="imagePath"
	 */
	@Column(name = "IMAGE_PATH")
	public String getImagePath() {
		return this.imagePath;
	}

	/**
	 * @param imagePath
	 * @uml.property  name="imagePath"
	 */
	public void setImagePath(String imagePath) {
		this.imagePath = imagePath;
	}

	/**
	 * @return
	 * @uml.property  name="versionNo"
	 */
	@Version
	@Column(name = "VERSION_NO", nullable = false, columnDefinition=" integer default 0 ")
	public int getVersionNo() {
		return this.versionNo;
	}

	/**
	 * @param versionNo
	 * @uml.property  name="versionNo"
	 */
	public void setVersionNo(int versionNo) {
		this.versionNo = versionNo;
	}

	/**
	 * @return
	 * @uml.property  name="menus"
	 */
	@OneToMany(fetch = FetchType.LAZY, mappedBy = "menu")
	public Set<Menu> getMenus() {
		return this.menus;
	}

	/**
	 * @param menus
	 * @uml.property  name="menus"
	 */
	public void setMenus(Set<Menu> menus) {
		this.menus = menus;
	}

	/**
	 * @return
	 * @uml.property  name="auditProperties"
	 */
	@Embedded
	public AuditProperties getAuditProperties() {
		return auditProperties;
	}

	/**
	 * @param auditProperties
	 * @uml.property  name="auditProperties"
	 */
	public void setAuditProperties(AuditProperties auditProperties) {
		this.auditProperties = auditProperties;
	}

}
